package cn.com.zpark.servlet_request;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @PackageName: cn.com.zpark.servlet_request
 * @ClassName: RequestDemo06
 * @Description:
 * @author: RZS
 * @date: 2021/11/14  16:09
 */
@WebServlet("/rd6.do")
public class RequestDemo06 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        /**
         * 当请求进来之后，转发到view/index.html
         */
        // 1、获取转发器
        RequestDispatcher dispatcher = request.getRequestDispatcher("/view/index.html");
        // 2、调用方法进行转发
        dispatcher.forward(request, response);
    }
}
